package team.kirohuji.service.impl.attendance;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import team.kirohuji.domain.attendance.Attendance;
import team.kirohuji.repository.jpa.attendance.AttendanceRepository;
import team.kirohuji.service.attendance.AttendanceService;

@Service("attendanceService")
public class AttendanceServiceImpl implements  AttendanceService {

	@Autowired
	private AttendanceRepository attendanceRepository;

	@Override
	public void update(Attendance attendance) {
		attendanceRepository.saveAndFlush(attendance);
	}

	@Override
	public Attendance findAttendanceByUserId(Integer userId) {
		return attendanceRepository.findAttendanceByUserId(userId);
	}

}
